package writtenexamination.yuewen;

import java.util.Scanner;

/**
 * @author cyt
 * @create 2020-10-21 下午 7:44
 */
public class Tb {
    public static void main(String[] args) {
        Scanner scs = new Scanner(System.in);
        int nextInt = scs.nextInt();
        int[][] arr = new int[nextInt + 1][nextInt + 1];
        for (int i = 0; i < nextInt; i++) {
            for (int j = 0; j < nextInt; j++) {
                arr[i][j] = scs.nextInt();
            }
        }
        StringBuffer buffer = new StringBuffer();
        for (int j = 0; j < arr[0].length; j++) {
            for (int i = arr.length - 1; i > -1; i--) {
                buffer.append(arr[i][j] + ",");
            }
        }
        String ans = buffer.toString().substring(0, buffer.toString().length() - 1);
        System.out.println(ans);
    }

    public void get() {

    }
}
